package com.avic.process.export.util;

import java.util.ArrayList;
import java.util.Arrays;

public class ExcelRow {
    public SheetBreakpoint breakpoint;
    public int row;
    public ColumnValue[] columns;

    public ExcelRow(int row, ColumnValue[] columns) {
	this.row = row;
	this.columns = columns;
    }

    public ColumnValue[] getGroupColumns() {
	ArrayList<ColumnValue> alGroup = new ArrayList<ColumnValue>();
	for (int i = 0; i < columns.length; i++) {
	    if (columns[i].Group == 1) {
		alGroup.add(columns[i]);
	    }
	}
	ColumnValue[] cvs = new ColumnValue[alGroup.size()];
	return alGroup.toArray(cvs);
    }

    public void setBreakpoint(SheetBreakpoint breakpoint) {
	this.breakpoint = breakpoint;
    }

    @Override
    public String toString() {
	return "ExcelRow [breakpoint=" + breakpoint + ", row=" + row
		+ ", columns=" + Arrays.toString(columns) + "]";
    }
}
